package com.example.homework.homework04;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        // 1.准备一个存放所有双色球的号码的集合
        List<String> doubleColorBalls = new ArrayList<>();

        // 2.向集合中添加号码
        for (int i = 0; i < 100; i++) {
            doubleColorBalls.add(DoubleColorBallUtils.create());
        }

        // 3.创建线程任务对象
        Runnable task = new EntranceTask(100,doubleColorBalls);

        // 4.创建线程对象
        Thread t1 = new Thread(task, "后门");
        Thread t2 = new Thread(task, "前门");

        // 5.启动线程
        t1.start();
        t2.start();
    }
}
